package com.lxk.service.impl;

import com.lxk.pojo.Users;
import com.lxk.dao.UsersMapper;
import com.lxk.service.UsersService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lxk.vo.WxUserMiniVO;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * <p>
 * 用户 服务实现类
 * </p>
 *
 * @author JohnSoybean
 * @since 2020-07-14
 */
@Service
public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements UsersService {

    @Override
    public Users wxUserMiniToUsers(WxUserMiniVO vo, String openid, String sessionKey) {
        Users users = new Users();
        users.setHeadimg(vo.getAvatarUrl());
        users.setUsername(vo.getNickName());
        users.setSex(vo.getGender());
        users.setOpenid(openid);
        users.setSessionKey(sessionKey);
        return users;
    }
}
